# coding: utf-8

import config
import app.tools as tool
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt, SIGNAL
from app.tools.dialog import MessageBox
from app.ui.icon import Icon
from app.ui.tab.tab_page_abstract import TabPageAbstract


class TabPageList(object):

    def __init__(self):
        self.icon = Icon()
        self.tab_widget_page = QtGui.QWidget()
        self.tab_widget_page.setObjectName(tool._from_utf8("tab_widget_page_list"))

        self.key_label_3 = QtGui.QLabel(self.tab_widget_page)
        self.key_label_3.setGeometry(QtCore.QRect(10, 20, 50, 18))
        self.key_label_3.setObjectName(tool._from_utf8("key_label_3"))
        self.key_label_3.setText(tool._translate("MainWindow", "LIST:", None))

        self.key_text_3 = QtGui.QLineEdit(self.tab_widget_page)
        self.key_text_3.setEnabled(False)
        self.key_text_3.setGeometry(QtCore.QRect(70, 10, 270, 30))
        self.key_text_3.setObjectName(tool._from_utf8("key_text_3"))

        self.key_delete_button_3 = QtGui.QPushButton(self.tab_widget_page)
        self.key_delete_button_3.setGeometry(QtCore.QRect(480, 10, 100, 30))
        self.key_delete_button_3.setIcon(self.icon.get(config.ICON_DEL))
        self.key_delete_button_3.setObjectName(tool._from_utf8("key_delete_button_3"))
        self.key_delete_button_3.setText(tool._translate("MainWindow", "Delete", None))

        self.key_save_button_3 = QtGui.QPushButton(self.tab_widget_page)
        self.key_save_button_3.setGeometry(QtCore.QRect(590, 10, 100, 30))
        self.key_save_button_3.setIcon(self.icon.get(config.ICON_EDIT_DB))
        self.key_save_button_3.setObjectName(tool._from_utf8("key_save_button_3"))
        self.key_save_button_3.setText(tool._translate("MainWindow", "Save", None))

        self.hash_table_2 = QtGui.QTableWidget(self.tab_widget_page)
        self.hash_table_2.setGeometry(QtCore.QRect(10, 50, 539, 189))
        self.hash_table_2.setLineWidth(5)
        self.hash_table_2.setMidLineWidth(5)
        self.hash_table_2.setObjectName(tool._from_utf8("hash_table_2"))
        self.hash_table_2.setColumnCount(2)
        self.hash_table_2.setRowCount(2)

        item = QtGui.QTableWidgetItem()
        item.setBackground(QtGui.QColor(170, 170, 255))
        self.hash_table_2.setVerticalHeaderItem(0, item)
        item = QtGui.QTableWidgetItem()
        self.hash_table_2.setVerticalHeaderItem(1, item)
        item = QtGui.QTableWidgetItem()
        item.setIcon(self.icon.get(config.ICON_UA))
        self.hash_table_2.setHorizontalHeaderItem(0, item)
        item = QtGui.QTableWidgetItem()
        item.setIcon(self.icon.get(config.ICON_UA))
        self.hash_table_2.setHorizontalHeaderItem(1, item)
        item = QtGui.QTableWidgetItem()
        self.hash_table_2.setItem(0, 0, item)
        item = QtGui.QTableWidgetItem()
        self.hash_table_2.setItem(0, 1, item)
        item = QtGui.QTableWidgetItem()
        self.hash_table_2.setItem(1, 0, item)
        item = QtGui.QTableWidgetItem()
        self.hash_table_2.setItem(1, 1, item)
        item = self.hash_table_2.horizontalHeaderItem(0)
        item.setText(tool._translate("MainWindow", "row", None))
        item = self.hash_table_2.horizontalHeaderItem(1)
        item.setText(tool._translate("MainWindow", "value", None))
        __sortingEnabled = self.hash_table_2.isSortingEnabled()
        self.hash_table_2.setSortingEnabled(False)
        item = self.hash_table_2.item(0, 0)
        item.setText(tool._translate("MainWindow", "1", None))
        item = self.hash_table_2.item(0, 1)
        item.setText(tool._translate("MainWindow", "value1", None))
        item = self.hash_table_2.item(1, 0)
        item.setText(tool._translate("MainWindow", "2", None))
        item = self.hash_table_2.item(1, 1)
        item.setText(tool._translate("MainWindow", "value2", None))
        self.hash_table_2.setSortingEnabled(__sortingEnabled)

        self.hash_add_row_button_2 = QtGui.QPushButton(self.tab_widget_page)
        self.hash_add_row_button_2.setGeometry(QtCore.QRect(560, 50, 131, 30))
        self.hash_add_row_button_2.setIcon(self.icon.get(config.ICON_ADD))
        self.hash_add_row_button_2.setObjectName(tool._from_utf8("hash_add_row_button_2"))
        self.hash_add_row_button_2.setText(tool._translate("MainWindow", "Add Row", None))

        self.hash_delete_row_button_2 = QtGui.QPushButton(self.tab_widget_page)
        self.hash_delete_row_button_2.setGeometry(QtCore.QRect(560, 90, 131, 30))
        self.hash_delete_row_button_2.setIcon(self.icon.get(config.ICON_DEL))
        self.hash_delete_row_button_2.setObjectName(tool._from_utf8("hash_delete_row_button_2"))
        self.hash_delete_row_button_2.setText(tool._translate("MainWindow", "Delete Row", None))

        self.hash_reload_value_button_2 = QtGui.QPushButton(self.tab_widget_page)
        self.hash_reload_value_button_2.setGeometry(QtCore.QRect(560, 130, 131, 30))
        self.hash_reload_value_button_2.setIcon(self.icon.get(config.ICON_REFRESH))
        self.hash_reload_value_button_2.setObjectName(tool._from_utf8("hash_reload_value_button_2"))
        self.hash_reload_value_button_2.setText(tool._translate("MainWindow", "Reload Value", None))

        self.hash_value_label_2 = QtGui.QLabel(self.tab_widget_page)
        self.hash_value_label_2.setGeometry(QtCore.QRect(10, 300, 51, 18))
        self.hash_value_label_2.setObjectName(tool._from_utf8("hash_value_label_2"))
        self.hash_value_label_2.setText(tool._translate("MainWindow", "Value:", None))

        self.value_format_label_3 = QtGui.QLabel(self.tab_widget_page)
        self.value_format_label_3.setGeometry(QtCore.QRect(450, 300, 101, 18))
        self.value_format_label_3.setObjectName(tool._from_utf8("value_format_label_3"))
        self.value_format_label_3.setText(tool._translate("MainWindow", "View value as:", None))

        self.value_format_select_3 = QtGui.QComboBox(self.tab_widget_page)
        self.value_format_select_3.setGeometry(QtCore.QRect(550, 290, 141, 31))
        self.value_format_select_3.setObjectName(tool._from_utf8("value_format_select_3"))
        self.value_format_select_3.addItem(tool._from_utf8(""))
        self.value_format_select_3.addItem(tool._from_utf8(""))
        self.value_format_select_3.setItemText(0, tool._translate("MainWindow", "XML", None))
        self.value_format_select_3.setItemText(1, tool._translate("MainWindow", "JSON", None))

        self.value_text_3 = QtGui.QTextEdit(self.tab_widget_page)
        self.value_text_3.setGeometry(QtCore.QRect(10, 330, 681, 181))
        self.value_text_3.setStyleSheet(tool._from_utf8("border-color: rgb(150, 150, 150);background-color: rgb(255, 255, 255);"))
        self.value_text_3.setObjectName(tool._from_utf8("value_text_3"))

        self.key_label_8 = QtGui.QLabel(self.tab_widget_page)
        self.key_label_8.setGeometry(QtCore.QRect(360, 20, 31, 18))
        self.key_label_8.setObjectName(tool._from_utf8("key_label_8"))
        self.key_label_8.setText(tool._translate("MainWindow", "TTL:", None))

        self.key_label_9 = QtGui.QLabel(self.tab_widget_page)
        self.key_label_9.setGeometry(QtCore.QRect(400, 20, 61, 18))
        self.key_label_9.setObjectName(tool._from_utf8("key_label_9"))
        self.key_label_9.setText(tool._translate("MainWindow", "-1", None))

    def get_instance(self):
        return self.tab_widget_page
